﻿@{

    var statics = ViewBag.Statistics;

    var maxOnline = ViewBag.MaxUserOnline;

    var usersOnline = ViewBag.UsersOnline as List<User>;
    
}
<div class="site-block white-t">
    <div class="header">
        <span class="collapse close" id="collapse_statis"></span><span class="icon"></span>
        <h1>@ForumContext.GetText(LanguageSection.STATIS, "HEADER")</h1>
    </div>
    <div id="panel_collapse_statis">
        <div class="site-block-head">
            @string.Format(ForumContext.GetText("STATIS", "USERS_ONLINE"), statics.TotalUsersOnline, statics.TotalUsersOnline - statics.Guests, statics.Guests)
        </div>
        <div class="site-block-content statis-panel">
            <span class="icon-48 users-online">&nbsp;</span>
            @Html.Raw(string.Format(ForumContext.GetText("STATIS", "MAX_USERS_ONLINE"), maxOnline.TotalUsersOnline, ForumContext.PrettyDate(maxOnline.Created)))
            <br />
            @if (usersOnline != null)
            {
                var x = 0;
                foreach (var u in usersOnline)
                {
                    x++;
                
                @string.Format("{0}", x > 1 ? ", " : "")   
                @Html.Link(ForumContext.GetAbsoluteUrl(ForumUrls.USER_INFO, u.UserName), u.UserName, new { @class = u.CssClass })
                    
                }
            }
        </div>
        <div class="site-block-head">@ForumContext.GetText("STATIS", "FORUM_STATIS")</div>
        <div class="site-block-content statis-panel">
        <span class="icon-48 forum-statis">&nbsp;</span>
            @Html.Raw(string.Format(ForumContext.GetText("STATIS", "TOTAL_STATIS"), statics.TotalUsers, statics.TotalTopics, statics.TotalPosts))<br />
            @Html.Raw(string.Format(ForumContext.GetText("STATIS", "NEW_IN_PAST_24HOURS"), statics.NewTopicsInPast24Hours, statics.NewPostsInPast24Hours, statics.NewUsersInPast24Hours))<br />
            @if (!string.IsNullOrWhiteSpace(statics.NewestUserID))
            {
                @Html.Raw(string.Format(ForumContext.GetText("STATIS", "NEWEST_MEMBER"), ForumContext.GetAbsoluteUrl(ForumUrls.USER_INFO, statics.NewestUserID), statics.NewestUserID))
            }
        </div>
    </div>
</div>
@*

<div class="widget white-t">
    <div class="header">
        <div class="collapse {collapseId:'#collapse-panel-statis'} close">
        </div>
        <span class="icon"></span>
        <h1>@ForumContext.GetText(LanguageSection.STATIS, "HEADER")</h1>
    </div>
    <div id="collapse-panel-statis">
        <table>
            <tr>
                <td class="caption">
                    @string.Format(ForumContext.GetText("STATIS", "USERS_ONLINE"), statics.TotalUsersOnline, statics.TotalUsersOnline - statics.Guests, statics.Guests)
                </td>
            </tr>
            <tr>
                <td class="table-cell statis-panel statis-user-online valign-top">
                    @Html.Raw(string.Format(ForumContext.GetText("STATIS", "MAX_USERS_ONLINE"), maxOnline.TotalUsersOnline, ForumContext.PrettyDate(maxOnline.Created)))
                    <br />
                </td>
            </tr>
            <tr>
                <td class="caption">
                    @ForumContext.GetText("STATIS", "FORUM_STATIS")
                </td>
            </tr>
            <tr>
                <td class="table-cell statis-panel statis-forum valign-top">
                    @Html.Raw(string.Format(ForumContext.GetText("STATIS", "TOTAL_STATIS"), statics.TotalUsers, statics.TotalTopics, statics.TotalPosts))<br />
                    @Html.Raw(string.Format(ForumContext.GetText("STATIS", "NEW_IN_PAST_24HOURS"), statics.NewTopicsInPast24Hours, statics.NewPostsInPast24Hours, statics.NewUsersInPast24Hours))<br />
                    @if (!string.IsNullOrWhiteSpace(statics.NewestUserID))
                    {
                        @Html.Raw(string.Format(ForumContext.GetText("STATIS", "NEWEST_MEMBER"), ForumContext.GetAbsoluteUrl(ForumUrls.USER_INFO, statics.NewestUserID), statics.NewestUserID))
                    }
                    <br />
                </td>
            </tr>
        </table>
    </div>
</div>
*@ 